package com.macro.mall.portal.config.sharding.ranghash;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @author wwj
 */
@Configuration
public class RangeHashConfig {

    @Bean
    @ConditionalOnProperty(havingValue = "true",name = "sharding.datasource.enable")
    public RangeHashShardInit rangeHashShardInit(){
        RangeHashShardInit rangeHashShardInit = new RangeHashShardInit();
        return rangeHashShardInit;
    }
}
